﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：YS_LH_YUETIAOZ实体层次
//********************************************************************************//
#region Entity
namespace Entity
{
    using System;
    using System.Xml;
    [Serializable()]
    public class YS_LH_YUETIAOZ
    {

        private string m_str_s_laihanbh;
        /// <summary>
        /// 来函编号
        /// </summary>
        public string S_LAIHANBH { get { return m_str_s_laihanbh; } set { m_str_s_laihanbh = value; } }

        private string m_str_s_zhandianbh;
        /// <summary>
        /// 站点
        /// </summary>
        public string S_ZHANDIANBH { get { return m_str_s_zhandianbh; } set { m_str_s_zhandianbh = value; } }

        private decimal? m_dec_i_y;
        /// <summary>
        /// 年
        /// </summary>
        public decimal? I_Y { get { return m_dec_i_y; } set { m_dec_i_y = value; } }

        private decimal? m_dec_i_m;
        /// <summary>
        /// 月
        /// </summary>
        public decimal? I_M { get { return m_dec_i_m; } set { m_dec_i_m = value; } }

        private decimal? m_dec_i_shenqingl;
        /// <summary>
        /// 申请量
        /// </summary>
        public decimal? I_SHENQINGL { get { return m_dec_i_shenqingl; } set { m_dec_i_shenqingl = value; } }

        private DateTime? m_DT_d_shururq;
        /// <summary>
        /// 输入日期
        /// </summary>
        public DateTime? D_SHURURQ { get { return m_DT_d_shururq; } set { m_DT_d_shururq = value; } }

        private decimal? m_dec_i_shurur;
        /// <summary>
        /// 输入人
        /// </summary>
        public decimal? I_SHURUR { get { return m_dec_i_shurur; } set { m_dec_i_shurur = value; } }

        private decimal? m_dec_i_jlzt;
        /// <summary>
        /// 记录状态(0:正常,1:删除)
        /// </summary>
        public decimal? I_JLZT { get { return m_dec_i_jlzt; } set { m_dec_i_jlzt = value; } }

        private string m_str_s_yonghubh;
        /// <summary>
        /// 用户编号
        /// </summary>
        public string S_YONGHUBH { get { return m_str_s_yonghubh; } set { m_str_s_yonghubh = value; } }

        private decimal m_dec_id;
        /// <summary>
        /// 主键
        /// </summary>
        public decimal ID { get { return m_dec_id; } set { m_dec_id = value; } }

        private string m_str_s_shenqingly;
        /// <summary>
        /// 申请理由
        /// </summary>
        public string S_SHENQINGLY { get { return m_str_s_shenqingly; } set { m_str_s_shenqingly = value; } }

        private string m_str_s_beizhu;
        /// <summary>
        /// 备注
        /// </summary>
        public string S_BEIZHU { get { return m_str_s_beizhu; } set { m_str_s_beizhu = value; } }

        private decimal? m_dec_i_yewuyjy;
        /// <summary>
        /// 业务员建议申请量
        /// </summary>
        public decimal? I_YEWUYJY { get { return m_dec_i_yewuyjy; } set { m_dec_i_yewuyjy = value; } }

        private string m_str_s_yewuyjy;
        /// <summary>
        /// 业务员建议信息
        /// </summary>
        public string S_YEWUYJY { get { return m_str_s_yewuyjy; } set { m_str_s_yewuyjy = value; } }

        private decimal? m_dec_i_zhuren;
        /// <summary>
        /// 主任复核量
        /// </summary>
        public decimal? I_ZHUREN { get { return m_dec_i_zhuren; } set { m_dec_i_zhuren = value; } }

        private string m_str_s_zhuren;
        /// <summary>
        /// 主任建议
        /// </summary>
        public string S_ZHUREN { get { return m_str_s_zhuren; } set { m_str_s_zhuren = value; } }

        private decimal? m_dec_i_jieshuikz;
        /// <summary>
        /// 节水科长审核量
        /// </summary>
        public decimal? I_JIESHUIKZ { get { return m_dec_i_jieshuikz; } set { m_dec_i_jieshuikz = value; } }

        private string m_str_s_jieshuikz;
        /// <summary>
        /// 节水科长建议
        /// </summary>
        public string S_JIESHUIKZ { get { return m_str_s_jieshuikz; } set { m_str_s_jieshuikz = value; } }

        private decimal? m_dec_i_jicaikz;
        /// <summary>
        /// 计财科长审核量
        /// </summary>
        public decimal? I_JICAIKZ { get { return m_dec_i_jicaikz; } set { m_dec_i_jicaikz = value; } }

        private string m_str_s_jicaikz;
        /// <summary>
        /// 计财科长
        /// </summary>
        public string S_JICAIKZ { get { return m_str_s_jicaikz; } set { m_str_s_jicaikz = value; } }

        private decimal? m_dec_i_chuzhang;
        /// <summary>
        /// 处长审核量
        /// </summary>
        public decimal? I_CHUZHANG { get { return m_dec_i_chuzhang; } set { m_dec_i_chuzhang = value; } }

        private string m_str_s_chuzhang;
        /// <summary>
        /// 处长意见
        /// </summary>
        public string S_CHUZHANG { get { return m_str_s_chuzhang; } set { m_str_s_chuzhang = value; } }

        private decimal? m_dec_i_syl_sy;
        /// <summary>
        /// 上月实用量
        /// </summary>
        public decimal? I_SYL_SY { get { return m_dec_i_syl_sy; } set { m_dec_i_syl_sy = value; } }

        private decimal? m_dec_i_jh_y;
        /// <summary>
        /// 原计划
        /// </summary>
        public decimal? I_JH_Y { get { return m_dec_i_jh_y; } set { m_dec_i_jh_y = value; } }

        private string m_str_s_caozuorqm;
        /// <summary>
        /// 电子签名
        /// </summary>
        public string S_CAOZUORQM { get { return m_str_s_caozuorqm; } set { m_str_s_caozuorqm = value; } }

        private decimal? m_dec_i_ywy;
        /// <summary>
        /// 业务员(操作人)
        /// </summary>
        public decimal? I_YWY { get { return m_dec_i_ywy; } set { m_dec_i_ywy = value; } }

        private DateTime? m_DT_d_ywy;
        /// <summary>
        /// 业务员操作时间
        /// </summary>
        public DateTime? D_YWY { get { return m_DT_d_ywy; } set { m_DT_d_ywy = value; } }

        private decimal? m_dec_i_zr;
        /// <summary>
        /// 主任(操作人)
        /// </summary>
        public decimal? I_ZR { get { return m_dec_i_zr; } set { m_dec_i_zr = value; } }

        private DateTime? m_DT_d_zr;
        /// <summary>
        /// 主任操作时间
        /// </summary>
        public DateTime? D_ZR { get { return m_DT_d_zr; } set { m_DT_d_zr = value; } }

        private decimal? m_dec_i_jsk;
        /// <summary>
        /// 节水科(操作人)
        /// </summary>
        public decimal? I_JSK { get { return m_dec_i_jsk; } set { m_dec_i_jsk = value; } }

        private DateTime? m_DT_d_jsk;
        /// <summary>
        /// 节水科操作时间
        /// </summary>
        public DateTime? D_JSK { get { return m_DT_d_jsk; } set { m_DT_d_jsk = value; } }

        private decimal? m_dec_i_jck;
        /// <summary>
        /// 计财科(操作人)
        /// </summary>
        public decimal? I_JCK { get { return m_dec_i_jck; } set { m_dec_i_jck = value; } }

        private DateTime? m_DT_d_jck;
        /// <summary>
        /// 计财科操作时间
        /// </summary>
        public DateTime? D_JCK { get { return m_DT_d_jck; } set { m_DT_d_jck = value; } }

        private decimal? m_dec_i_cz;
        /// <summary>
        /// 处长(操作人)
        /// </summary>
        public decimal? I_CZ { get { return m_dec_i_cz; } set { m_dec_i_cz = value; } }

        private DateTime? m_DT_d_cz;
        /// <summary>
        /// 处长操作时间
        /// </summary>
        public DateTime? D_CZ { get { return m_DT_d_cz; } set { m_DT_d_cz = value; } }
        public YS_LH_YUETIAOZ()
        {
        }
    }
}
#endregion
#region EntityProcess
namespace BLL.Access
{
    using System;
    using System.Data;
    //using System.Data.OracleClient;
    using Entity;
    using System.Configuration;
    using System.Data.Common;
    using Platform.Data;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    using Oracle.DataAccess;
    public class YS_LH_YUETIAOZProcess
    {
        #region Field
        protected string conn;
        #endregion
        #region Construction
        public YS_LH_YUETIAOZProcess() { conn = Platform.Configuration.ConfigHelper.PlatformConnString; }
        #endregion
        #region public

        /// <summary>
        /// 根据YS_LH_YUETIAOZ实体添加或者修改YS_LH_YUETIAOZ信息
        /// </summary>
        public bool InsertOrUpdate(YS_LH_YUETIAOZ YS_LH_YUETIAOZ, OracleTransaction Transaction)
        {
            if (YS_LH_YUETIAOZ.ID == 0)
            {
                InsertYS_LH_YUETIAOZ(YS_LH_YUETIAOZ, Transaction);
            }
            else
            {
                UpdateYS_LH_YUETIAOZ(YS_LH_YUETIAOZ, Transaction);
            }
            return YS_LH_YUETIAOZ.ID == 0 ? false : true;
        }

        /// <summary>
        /// 根据YS_LH_YUETIAOZ实体添加或修改YS_LH_YUETIAOZ信息
        /// </summary>
        public bool InsertOrUpdate(YS_LH_YUETIAOZ YS_LH_YUETIAOZ)
        {
            return InsertOrUpdate(YS_LH_YUETIAOZ, null);
        }



        /// <summary>
        /// 根据YS_LH_YUETIAOZ主键删除YS_LH_YUETIAOZ信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_LH_YUETIAOZ(decimal ID, OracleTransaction Transaction)
        {
            string spName = "CS_DelYS_LH_YUETIAOZ";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        /// 根据YS_LH_YUETIAOZ主键删除YS_LH_YUETIAOZ信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_LH_YUETIAOZ(decimal ID)
        {
            return DeleteYS_LH_YUETIAOZ(ID, null);
        }

        /// <summary>
        /// 根据条件删除YS_LH_YUETIAOZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_LH_YUETIAOZsDynamic(string WhereClause, OracleTransaction Transaction)
        {
            string spName = "CS_DelYS_LH_YUETIAOZsDyn";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        /// 根据条件删除YS_LH_YUETIAOZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_LH_YUETIAOZsDynamic(string WhereClause)
        {
            return DeleteYS_LH_YUETIAOZsDynamic(WhereClause, null);
        }

        /// <summary>
        /// 根据YS_LH_YUETIAOZ主键选择YS_LH_YUETIAOZ信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_LH_YUETIAOZ信息</returns>
        public YS_LH_YUETIAOZ SelectYS_LH_YUETIAOZ(decimal ID, OracleTransaction Transaction)
        {
            string spName = "CS_SelYS_LH_YUETIAOZ";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                YS_LH_YUETIAOZ YS_LH_YUETIAOZ = PopulateYS_LH_YUETIAOZ(rd);
                rd.Close();
                return YS_LH_YUETIAOZ;
            }
            else
                return null;
        }

        /// <summary>
        /// 根据YS_LH_YUETIAOZ主键选择YS_LH_YUETIAOZ信息
        /// </summary>
        /// <returns>YS_LH_YUETIAOZ信息</returns>
        public YS_LH_YUETIAOZ SelectYS_LH_YUETIAOZ(decimal ID)
        {
            return SelectYS_LH_YUETIAOZ(ID, null);
        }

        /// <summary>
        /// 选择所有YS_LH_YUETIAOZ信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有YS_LH_YUETIAOZ信息</returns>
        public DataTable SelectYS_LH_YUETIAOZsAll(OracleTransaction Transaction)
        {
            string spName = "CS_SelYS_LH_YUETIAOZsAll";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            else
                return null;
        }

        /// <summary>
        /// 选择所有YS_LH_YUETIAOZ信息
        /// </summary>
        /// <returns>所有YS_LH_YUETIAOZ信息</returns>
        public DataTable SelectYS_LH_YUETIAOZsAll()
        {
            return SelectYS_LH_YUETIAOZsAll(null);
        }

        /// <summary>
        /// 根据条件选择YS_LH_YUETIAOZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_LH_YUETIAOZ信息</returns>
        public DataTable SelectYS_LH_YUETIAOZsDynamic(string WhereClause, string OrderByExpression, OracleTransaction Transaction)
        {
            string spName = "CS_SelYS_LH_YUETIAOZsDyn";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            else
                return null;
        }


        /// <summary>
        /// 根据条件选择YS_LH_YUETIAOZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>YS_LH_YUETIAOZ信息</returns>
        public DataTable SelectYS_LH_YUETIAOZsDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectYS_LH_YUETIAOZsDynamic(WhereClause, OrderByExpression, null);
        }



        /// <summary>
        /// 根据条件选择YS_LH_YUETIAOZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_LH_YUETIAOZ信息</returns>
        public DataTable SelectYS_LH_YUETIAOZsDynamic(string WhereClause, string OrderByExpression, int PageIndex, int PageSize, OracleTransaction Transaction)
        {
            string spName = "CS_SelYS_LH_YUETIAOZsDynPaged";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            else
                return null;
        }


        /// <summary>
        /// 根据条件选择YS_LH_YUETIAOZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>YS_LH_YUETIAOZ信息</returns>
        public DataTable SelectYS_LH_YUETIAOZsDynamic(string WhereClause, string OrderByExpression, int PageIndex, int PageSize)
        {
            return SelectYS_LH_YUETIAOZsDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///根据条件更新YS_LH_YUETIAOZ字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_LH_YUETIAOZsDynamic(string UpdateValue, string WhereClause, OracleTransaction Transaction)
        {
            int result = 0;
            if (UpdateValue == "" || WhereClause == "")
            {
                return 0;
            }
            string spName = "CS_UpdYS_LH_YUETIAOZDyn";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///根据条件更新YS_LH_YUETIAOZ字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_LH_YUETIAOZsDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateYS_LH_YUETIAOZsDynamic(UpdateValue, WhereClause, null);
        }


        #endregion
        #region Private

        private int InsertYS_LH_YUETIAOZ(YS_LH_YUETIAOZ YS_LH_YUETIAOZ, OracleTransaction Transaction)
        {
            string spName = "CS_InsYS_LH_YUETIAOZ";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_LH_YUETIAOZ.S_LAIHANBH;
            storedParams[1].Value = YS_LH_YUETIAOZ.S_ZHANDIANBH;
            storedParams[2].Value = YS_LH_YUETIAOZ.I_Y;
            storedParams[3].Value = YS_LH_YUETIAOZ.I_M;
            storedParams[4].Value = YS_LH_YUETIAOZ.I_SHENQINGL;
            storedParams[5].Value = YS_LH_YUETIAOZ.D_SHURURQ;
            storedParams[6].Value = YS_LH_YUETIAOZ.I_SHURUR;
            storedParams[7].Value = YS_LH_YUETIAOZ.I_JLZT;
            storedParams[8].Value = YS_LH_YUETIAOZ.S_YONGHUBH;
            storedParams[9].Value = YS_LH_YUETIAOZ.S_SHENQINGLY;
            storedParams[10].Value = YS_LH_YUETIAOZ.S_BEIZHU;
            storedParams[11].Value = YS_LH_YUETIAOZ.I_YEWUYJY;
            storedParams[12].Value = YS_LH_YUETIAOZ.S_YEWUYJY;
            storedParams[13].Value = YS_LH_YUETIAOZ.I_ZHUREN;
            storedParams[14].Value = YS_LH_YUETIAOZ.S_ZHUREN;
            storedParams[15].Value = YS_LH_YUETIAOZ.I_JIESHUIKZ;
            storedParams[16].Value = YS_LH_YUETIAOZ.S_JIESHUIKZ;
            storedParams[17].Value = YS_LH_YUETIAOZ.I_JICAIKZ;
            storedParams[18].Value = YS_LH_YUETIAOZ.S_JICAIKZ;
            storedParams[19].Value = YS_LH_YUETIAOZ.I_CHUZHANG;
            storedParams[20].Value = YS_LH_YUETIAOZ.S_CHUZHANG;
            storedParams[21].Value = YS_LH_YUETIAOZ.I_SYL_SY;
            storedParams[22].Value = YS_LH_YUETIAOZ.I_JH_Y;
            storedParams[23].Value = YS_LH_YUETIAOZ.S_CAOZUORQM;
            storedParams[24].Value = YS_LH_YUETIAOZ.I_YWY;
            storedParams[25].Value = YS_LH_YUETIAOZ.D_YWY;
            storedParams[26].Value = YS_LH_YUETIAOZ.I_ZR;
            storedParams[27].Value = YS_LH_YUETIAOZ.D_ZR;
            storedParams[28].Value = YS_LH_YUETIAOZ.I_JSK;
            storedParams[29].Value = YS_LH_YUETIAOZ.D_JSK;
            storedParams[30].Value = YS_LH_YUETIAOZ.I_JCK;
            storedParams[31].Value = YS_LH_YUETIAOZ.D_JCK;
            storedParams[32].Value = YS_LH_YUETIAOZ.I_CZ;
            storedParams[33].Value = YS_LH_YUETIAOZ.D_CZ;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            YS_LH_YUETIAOZ.ID = Convert.ToInt32(storedParams[34].Value);
            return result;
        }
        private bool UpdateYS_LH_YUETIAOZ(YS_LH_YUETIAOZ YS_LH_YUETIAOZ, OracleTransaction Transaction)
        {
            string spName = "CS_UpdYS_LH_YUETIAOZ";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_LH_YUETIAOZ.S_LAIHANBH;
            storedParams[1].Value = YS_LH_YUETIAOZ.S_ZHANDIANBH;
            storedParams[2].Value = YS_LH_YUETIAOZ.I_Y;
            storedParams[3].Value = YS_LH_YUETIAOZ.I_M;
            storedParams[4].Value = YS_LH_YUETIAOZ.I_SHENQINGL;
            storedParams[5].Value = YS_LH_YUETIAOZ.D_SHURURQ;
            storedParams[6].Value = YS_LH_YUETIAOZ.I_SHURUR;
            storedParams[7].Value = YS_LH_YUETIAOZ.I_JLZT;
            storedParams[8].Value = YS_LH_YUETIAOZ.S_YONGHUBH;
            storedParams[9].Value = YS_LH_YUETIAOZ.S_SHENQINGLY;
            storedParams[10].Value = YS_LH_YUETIAOZ.S_BEIZHU;
            storedParams[11].Value = YS_LH_YUETIAOZ.I_YEWUYJY;
            storedParams[12].Value = YS_LH_YUETIAOZ.S_YEWUYJY;
            storedParams[13].Value = YS_LH_YUETIAOZ.I_ZHUREN;
            storedParams[14].Value = YS_LH_YUETIAOZ.S_ZHUREN;
            storedParams[15].Value = YS_LH_YUETIAOZ.I_JIESHUIKZ;
            storedParams[16].Value = YS_LH_YUETIAOZ.S_JIESHUIKZ;
            storedParams[17].Value = YS_LH_YUETIAOZ.I_JICAIKZ;
            storedParams[18].Value = YS_LH_YUETIAOZ.S_JICAIKZ;
            storedParams[19].Value = YS_LH_YUETIAOZ.I_CHUZHANG;
            storedParams[20].Value = YS_LH_YUETIAOZ.S_CHUZHANG;
            storedParams[21].Value = YS_LH_YUETIAOZ.I_SYL_SY;
            storedParams[22].Value = YS_LH_YUETIAOZ.I_JH_Y;
            storedParams[23].Value = YS_LH_YUETIAOZ.S_CAOZUORQM;
            storedParams[24].Value = YS_LH_YUETIAOZ.I_YWY;
            storedParams[25].Value = YS_LH_YUETIAOZ.D_YWY;
            storedParams[26].Value = YS_LH_YUETIAOZ.I_ZR;
            storedParams[27].Value = YS_LH_YUETIAOZ.D_ZR;
            storedParams[28].Value = YS_LH_YUETIAOZ.I_JSK;
            storedParams[29].Value = YS_LH_YUETIAOZ.D_JSK;
            storedParams[30].Value = YS_LH_YUETIAOZ.I_JCK;
            storedParams[31].Value = YS_LH_YUETIAOZ.D_JCK;
            storedParams[32].Value = YS_LH_YUETIAOZ.I_CZ;
            storedParams[33].Value = YS_LH_YUETIAOZ.D_CZ;
            storedParams[34].Value = YS_LH_YUETIAOZ.ID;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private YS_LH_YUETIAOZ PopulateYS_LH_YUETIAOZ(IDataReader dr)
        {
            YS_LH_YUETIAOZ YS_LH_YUETIAOZ = new YS_LH_YUETIAOZ();
            YS_LH_YUETIAOZ.S_LAIHANBH = dr["S_LAIHANBH"] == DBNull.Value ? "" : (string)dr["S_LAIHANBH"];
            YS_LH_YUETIAOZ.S_ZHANDIANBH = dr["S_ZHANDIANBH"] == DBNull.Value ? null : (string)dr["S_ZHANDIANBH"];
            YS_LH_YUETIAOZ.I_Y = dr["I_Y"] == DBNull.Value ? null : (decimal?)dr["I_Y"];
            YS_LH_YUETIAOZ.I_M = dr["I_M"] == DBNull.Value ? null : (decimal?)dr["I_M"];
            YS_LH_YUETIAOZ.I_SHENQINGL = dr["I_SHENQINGL"] == DBNull.Value ? null : (decimal?)dr["I_SHENQINGL"];
            YS_LH_YUETIAOZ.D_SHURURQ = dr["D_SHURURQ"] == DBNull.Value ? null : (DateTime?)dr["D_SHURURQ"];
            YS_LH_YUETIAOZ.I_SHURUR = dr["I_SHURUR"] == DBNull.Value ? null : (decimal?)dr["I_SHURUR"];
            YS_LH_YUETIAOZ.I_JLZT = dr["I_JLZT"] == DBNull.Value ? null : (decimal?)dr["I_JLZT"];
            YS_LH_YUETIAOZ.S_YONGHUBH = dr["S_YONGHUBH"] == DBNull.Value ? null : (string)dr["S_YONGHUBH"];
            YS_LH_YUETIAOZ.ID = dr["ID"] == DBNull.Value ? (decimal)0 : (decimal)dr["ID"];
            YS_LH_YUETIAOZ.S_SHENQINGLY = dr["S_SHENQINGLY"] == DBNull.Value ? null : (string)dr["S_SHENQINGLY"];
            YS_LH_YUETIAOZ.S_BEIZHU = dr["S_BEIZHU"] == DBNull.Value ? null : (string)dr["S_BEIZHU"];
            YS_LH_YUETIAOZ.I_YEWUYJY = dr["I_YEWUYJY"] == DBNull.Value ? null : (decimal?)dr["I_YEWUYJY"];
            YS_LH_YUETIAOZ.S_YEWUYJY = dr["S_YEWUYJY"] == DBNull.Value ? null : (string)dr["S_YEWUYJY"];
            YS_LH_YUETIAOZ.I_ZHUREN = dr["I_ZHUREN"] == DBNull.Value ? null : (decimal?)dr["I_ZHUREN"];
            YS_LH_YUETIAOZ.S_ZHUREN = dr["S_ZHUREN"] == DBNull.Value ? null : (string)dr["S_ZHUREN"];
            YS_LH_YUETIAOZ.I_JIESHUIKZ = dr["I_JIESHUIKZ"] == DBNull.Value ? null : (decimal?)dr["I_JIESHUIKZ"];
            YS_LH_YUETIAOZ.S_JIESHUIKZ = dr["S_JIESHUIKZ"] == DBNull.Value ? null : (string)dr["S_JIESHUIKZ"];
            YS_LH_YUETIAOZ.I_JICAIKZ = dr["I_JICAIKZ"] == DBNull.Value ? null : (decimal?)dr["I_JICAIKZ"];
            YS_LH_YUETIAOZ.S_JICAIKZ = dr["S_JICAIKZ"] == DBNull.Value ? null : (string)dr["S_JICAIKZ"];
            YS_LH_YUETIAOZ.I_CHUZHANG = dr["I_CHUZHANG"] == DBNull.Value ? null : (decimal?)dr["I_CHUZHANG"];
            YS_LH_YUETIAOZ.S_CHUZHANG = dr["S_CHUZHANG"] == DBNull.Value ? null : (string)dr["S_CHUZHANG"];
            YS_LH_YUETIAOZ.I_SYL_SY = dr["I_SYL_SY"] == DBNull.Value ? null : (decimal?)dr["I_SYL_SY"];
            YS_LH_YUETIAOZ.I_JH_Y = dr["I_JH_Y"] == DBNull.Value ? null : (decimal?)dr["I_JH_Y"];
            YS_LH_YUETIAOZ.S_CAOZUORQM = dr["S_CAOZUORQM"] == DBNull.Value ? null : (string)dr["S_CAOZUORQM"];
            YS_LH_YUETIAOZ.I_YWY = dr["I_YWY"] == DBNull.Value ? null : (decimal?)dr["I_YWY"];
            YS_LH_YUETIAOZ.D_YWY = dr["D_YWY"] == DBNull.Value ? null : (DateTime?)dr["D_YWY"];
            YS_LH_YUETIAOZ.I_ZR = dr["I_ZR"] == DBNull.Value ? null : (decimal?)dr["I_ZR"];
            YS_LH_YUETIAOZ.D_ZR = dr["D_ZR"] == DBNull.Value ? null : (DateTime?)dr["D_ZR"];
            YS_LH_YUETIAOZ.I_JSK = dr["I_JSK"] == DBNull.Value ? null : (decimal?)dr["I_JSK"];
            YS_LH_YUETIAOZ.D_JSK = dr["D_JSK"] == DBNull.Value ? null : (DateTime?)dr["D_JSK"];
            YS_LH_YUETIAOZ.I_JCK = dr["I_JCK"] == DBNull.Value ? null : (decimal?)dr["I_JCK"];
            YS_LH_YUETIAOZ.D_JCK = dr["D_JCK"] == DBNull.Value ? null : (DateTime?)dr["D_JCK"];
            YS_LH_YUETIAOZ.I_CZ = dr["I_CZ"] == DBNull.Value ? null : (decimal?)dr["I_CZ"];
            YS_LH_YUETIAOZ.D_CZ = dr["D_CZ"] == DBNull.Value ? null : (DateTime?)dr["D_CZ"];
            return YS_LH_YUETIAOZ;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
            }
        }
        #endregion
    }
}
#endregion